<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>域对象的使用</title>
</head>
<body>
<%--
    通过key 从域对象中取值  如果没有指定域对象  则El表达式会从小范围到大范围依次获取
    pageContext    request   session  application
--%>
<%

    pageContext.setAttribute("pagecontext", "pageContextValue");
    request.setAttribute("request", "requestValue");
    request.setAttribute("info", "helloRequest");

    session.setAttribute("session", "sessionValue");
    session.setAttribute("info", "helloSession");

    application.setAttribute("application", "applicationValue");

%>

page:${pagecontext}<br>
request:${request} <br>
session:${session}  <br>
application:${application} <br>
<%--指定作用域下 获取key所对应的值--%>
requestInfo:${requestScope.info}
sessionInfo:${sessionScope.info}

<a href="${pageContext.request.contextPath}/scop2.jsp">scop2</a>

</body>
</html>
